//
//  HomePageScrollViewModel.m
//  InSuger
//
//  Created by dllo on 15/11/28.
//  Copyright © 2015年 Dior_3g. All rights reserved.
//

#import "HomePageScrollViewModel.h"

@implementation HomePageScrollViewModel

- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:self.photo forKey:@"photo"];
    [aCoder encodeObject:self.extend forKey:@"extend"];
    [aCoder encodeObject:self.index forKey:@"index"];
    [aCoder encodeObject:self.type forKey:@"type"];
    [aCoder encodeObject:self.title forKey:@"title"];
    
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    
    self = [super init];
    if (self) {
        
        //      解码的操作
        //      把解码之后的值再赋值给属性
        
        self.photo = [aDecoder decodeObjectForKey:@"photo"];
        self.extend = [aDecoder decodeObjectForKey:@"extend"];
        self.index = [aDecoder decodeObjectForKey:@"index"];
        self.type = [aDecoder decodeObjectForKey:@"type"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        
    }
    return self;
    
}

- (instancetype)initWithPhoto:(NSString *)photo extend:(NSString *)extend index:(NSNumber *)index type:(NSString *)type title:(NSString *)title{
    
    self = [super init];
    
    if (self) {
        
        self.photo = photo;
        self.extend = extend;
        self.index = index;
        self.type = type;
        self.title = title;
        
    }
    return self;
    
}

@end
